package interfaces;

import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;
import java.util.ResourceBundle;

import annotations.AsCommand;
import annotations.Default;
import exceptions.NotEnoughSharesToSell;
import exceptions.WrongParameterException;
import exceptions.WrongPlayerName;
import exceptions.WrongShareName;

/**
 * @author porku_000
 */
public interface AccountManager {

	@AsCommand(commandShellCommando = "crp", description = "<name> * create a new player by name")
	public abstract void createPlayer(String name) throws Exception;

	@AsCommand(commandShellCommando = "ss", description = "<playername> <sharename> <amount> * sell that amount of shares")
	public abstract void sellShare(String playerName, String shareName,
			int countShares) throws NotEnoughSharesToSell, WrongShareName, WrongPlayerName;

	@AsCommand(commandShellCommando = "bs", description = "<playername> <sharename> <amount> * buy that amount of shares")
	public abstract void buyShare(String playerName, String shareName,
			int countShares) throws Exception;
	
	@AsCommand(commandShellCommando = "getvalue", description = "<playername> <assetname> get value")
	public abstract float countValueAsset(String playerName, String assetName) throws WrongPlayerName;
	
	
	
	//public abstract long countValueAllAsset(String playerName);

	
	@AsCommand(commandShellCommando = "printall", description = "print all values // wont print on console")
	public abstract String getAllSharesAndCoursesOfAllPlayersToString(ResourceBundle prop);
	
/*	@AsCommand(commandShellCommando = "help", description = "get help")
	public abstract void help();
	
	@AsCommand(commandShellCommando = "exit", description = "exit game")
	public abstract void exit();*/

	
	
	@AsCommand(commandShellCommando = "agent", description = "<playername> activate player agent")
	public abstract void playerAgent(String playername) throws Exception;
	
	
	@AsCommand(commandShellCommando = "da", description = "<playername> deactivate agent")
	public abstract void deactivatePlayerAgent(String playername) throws Exception;
	
	@AsCommand(commandShellCommando = "gbs", description = "<playername><ordered by time't' or sharename'o' or only sharename><mimetype 'text' or 'html'><optional: number>")
	public abstract void getBankStatement(String playername, String param, String mimetype, @Default int countStatements) throws WrongParameterException, FileNotFoundException, UnsupportedEncodingException;
	
	@AsCommand(commandShellCommando = "as", description = "<sharename> create new share")
	public abstract void addShare(String shareName) throws WrongShareName;
}
